package internal

import (
	"math/rand"
	"time"
)

var keyChars = []byte("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

func genKey(n int) string {
	rand.Seed(time.Now().Unix())
	l := len(keyChars)
	c := make([]byte, n, n)
	for i := n; i > 0; i-- {
		index := rand.Intn(l)
		randChar := keyChars[index]
		c[i-1] = randChar
	}
	return string(c)
}
